/**
 * @系统管理
 */
 const Router = require('koa-router');
const { getMenuListById, getRoleList, getMenuList, addRole } = require('../controller/system.controller');
const { verifyAuth } = require('../middleware/auth.middleware');
const { handleMenuData } = require('../middleware/system.middleware');
const systemRouter = new Router({ prefix: '/api' });

//菜单管理
//通过userId查询菜单
systemRouter.get('/getMenuList/:userId', verifyAuth, handleMenuData, getMenuListById)
// 查询所有角色列表
systemRouter.get('/getRoleList', verifyAuth, getRoleList)
// 查询所有菜单列表
systemRouter.get('/getMenuListTotal', verifyAuth, getMenuList);
//新增角色权限
systemRouter.post('/addRole', verifyAuth, addRole);
//删除角色权限
systemRouter.delete('/deleteRole', verifyAuth)

 module.exports = systemRouter;